#include <ctype.h>
#include <limits.h>
#include <math.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>

#include "uthash.h"

#include <iso646.h>

int dominantIndex(int* nums, int numsSize);

int main()
{
	return 0;
}

int dominantIndex(int* nums, int numsSize)
{
	int max = 0, premax = 0, max_idx = 0;
	for (int i = 0, cur_num; i < numsSize; i++)
		if ((cur_num = nums[i]) > max) {
			premax = max;
			max = cur_num;
			max_idx = i;
		}

	return max >= 2 * premax ? max_idx : -1;
}
